<h2 class="col-sm-offset-2 col-lg-offset-3">
<span ng-if="type=='add'">{{ _('Add user') }}</span>
<span ng-if="type=='edit'">{{ _('Edit user') }}</span>
</h2>
<hr/>
<form class="form-horizontal" role="form" ng-submit="save()">
    <div class="form-group required">
        <label for="name" class="col-sm-2 col-lg-offset-1 control-label">{{ _('User name') }}</label>

        <div class="col-sm-4">
            <input type="text" class="form-control" id="name" required autofocus
                   ng-model="user.name" placeholder="{{ _('User name') }}">
        </div>
    </div>
    <div class="form-group required">
        <label for="real_name" class="col-sm-2 col-lg-offset-1 control-label">{{ _('Real name') }}</label>

        <div class="col-sm-4">
            <input type="text" class="form-control" id="real_name" required
                   ng-model="user.real_name" placeholder="{{ _('Real name') }}">
        </div>
    </div>
    <div class="form-group required">
        <label for="pwd" class="col-sm-2 col-lg-offset-1 control-label">{{ _('Password') }}</label>

        <div class="col-sm-4">
            <input type="password" class="form-control" id="pwd" required
                   ng-model="user.pwd" placeholder="{{ _('Password') }}">
        </div>
    </div>
    <div class="form-group required">
        <label for="repeat_pwd" class="col-sm-2 col-lg-offset-1 control-label">{{ _('Repeat password') }}</label>

        <div class="col-sm-4">
            <input type="password" class="form-control" id="repeat_pwd" required
                   ng-model="user.repeat_pwd" placeholder="{{ _('Repeat password') }}">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-4 col-lg-offset-3">
            <alert ng-repeat="alert in alerts" ng-attr-type="[[ alert.type ]]" close="closeAlert($index)">
                <span ng-bind="alert.msg"></span>
            </alert>
            <button type="submit" class="btn btn-primary">{{ _('Ok') }}</button>
            <a href="{{ url_for('userlist') }}" class="btn btn-danger">{{ _('Cancel') }}</a>
        </div>
    </div>
</form>